<template>
        <el-header>
          <img src="../../public/assets/tree.webp">
          <p v-if="have_return_flg">
            <el-button type="info" @click="returnPrePage">返回</el-button>
          </p>
        </el-header>
</template>

<script>
export default {
  props: {
    // 接收父组件传递的 text 值
    have_return_flg: {
      type: Boolean, // 声明为字符串类型
      required: true, // 确保必须传递
    },
  },
  data() {
    return {
      message: 'Hello, Vue 3!'
    };
  },
  methods: {
    returnPrePage() {
      // 通过 $emit 向父组件发送事件
      this.$emit("stop-scan");
      this.$router.push('/');
    }
  },

};
</script>

<style>

.el-header{
    background-color: #afc7d1;
    display: flex;
    justify-content: space-between;
    padding-left: 0;
    align-items: center;
    color: #1ff8d4;
    font-size: 5px;
    width: 100%;
}

</style>